<h1>kenshou's blogs</h1>

<table>

  <% for @blog in @blogs %>
    <tr>
      <td><%= render :partial => 'show' %></td>
      <%if session[:user_id]%>
        <td><%= link_to 'Show', @blog %></td>
        <td><%= link_to 'Edit', edit_blog_path(@blog) %></td>
        <td><%= link_to 'Destroy', @blog, :confirm => 'Are you sure?', :method => :delete %></td>
      <%end%>
    </tr>
  <% end %>
</table>
<%=will_paginate (@blogs)%>
<br />
<%if session[:user_id]%>
  <%= link_to '新建', new_blog_path %>
  <%=link_to '退出' ,:controller=>:user,:action=>:logout%>
<%else%>
  <%=link_to '登录' ,:controller=>:user,:action=>:login%>
<%end%>
<br/>